#ifndef ONNXRUNTIMEOBJ_H
#define ONNXRUNTIMEOBJ_H

#include <QObject>

class OnnxRuntimeObj:public QObject
{
    Q_OBJECT
public:
    explicit OnnxRuntimeObj(QObject *parent = nullptr);
    ~OnnxRuntimeObj();

    ///
    /// \brief initSession
    /// \param filename
    /// \return
    ///初始化计算图
    bool initSession(const QString& filename);


    ///
    /// \brief getSessionInputShape
    /// \param shape
    /// \return
    ///获取计算图中输入的形状写入到shape,成功返回true
    bool getSessionInputShape(std::vector<int64_t>& shape);

    ///
    /// \brief sessionInfer
    /// \return
    ///执行计算图
    bool sessionInfer(float *input,const std::vector<int64_t> & inshape,float **output,std::vector<int64_t> & outshape);

signals:
    ///
    /// \brief toastInfo
    /// \param info
    /// \param color
    ///弹出信息到 信息栏
    void toastInfo(QString info,QString color="black");
};

#endif // ONNXRUNTIMEOBJ_H
